//package com.czkt.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.security.web.SecurityFilterChain;
//
//@Configuration
////@EnableMethodSecurity
//public class SecurityConfig{
//
//    @Autowired
//    CoustUserDetailService userDetailsService;
//
//    @Autowired
//    CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler;
//
//    @Autowired
//    JwtAuthenticationFilter jwtAuthenticationFilter;
//
//    @Autowired
//    CustoAuthenticationFailHandler custoAuthenticationFailHandler;
//
//    @Autowired
//    CustoAuthenticationEntryPoint authenticationEntryPoint;
//
//    @Autowired
//    CustoAccessDeniedHandler accessDeniedHandler;
//
//    @Bean
//    public PasswordEncoder passwordEncoder(){
//        return new BCryptPasswordEncoder();
//    }
//
//    @Bean
//    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
//        return http
//                .formLogin(formLogin->formLogin.successHandler(customAuthenticationSuccessHandler).failureHandler(custoAuthenticationFailHandler).permitAll())
//                .authorizeHttpRequests(author->author.anyRequest().authenticated())
//                .userDetailsService(userDetailsService)
//                .exceptionHandling(exception->
//                        exception
////                                .authenticationEntryPoint(authenticationEntryPoint)
//                                .accessDeniedHandler(accessDeniedHandler)
//                )
//                .build();
//    }
//}
